{extend name="$index_style_layout" /}

<!--SEO相关-->
{block name="head_title"}{$fid?($info['seo_title']?:$info['name']):$m_info['title']}{/block}
{block name="head_keword"}{$fid?($info['seo_keywords']?:$info['name']):$m_info['title']}{/block}
{block name="head_description"}{$info.seo_description}{/block}

{block name="body_AllScorllSlide"}
<!--通栏横幅图片__STATIC__/css/qb_ui.css中控制图片宽度百分百高度行内样式设置，如不设置不小于100px---->
{qb:tag name="web_banner_pic01" type="image"}
<!--
<div class="qb_ui_AllscrollBanner" style="height:300px;">
	<a href="#1"><img src="__STATIC__/images/s0.jpg"></a>
</div>
-->
<div class="qb_ui_AllscrollBanner" style="height:300px;">
	<a href="{$url}"><img src="{$picurl}"></a>
</div>
{/qb:tag}
{/block}
{block name="body_content"}
<link rel="stylesheet" href="__STATIC__/index/default/pclist.css">
<div class="ArticlMainContainer">
	<div class="LeftsCnt">
		<link rel="stylesheet" href="__STATIC__/index/default/left.css">
		<div class="LeftBoxInfo">
			<ul class="sorts">
				<li class="{$type==0?'ck':''}"><a href="?type=0&mid={$mid}">播放记录</a></li>
				<li class="{$type==1?'ck':''}"><a href="?type=1&mid={$mid}">我的收藏</a></li>
			</ul>
		</div>
	</div>
	<div class="RightCnt">
		
<!----------音乐播放器开始-------->
<link rel="stylesheet" href="__STATIC__/libs/jplayer/css/style.css"/>
<style type="text/css">
#voice{
	width:100%;
    height:600px;    
    margin:0 auto;
}
.qb_ui_ListArticleTimeTitleCnt h3 a.choose{
	color:red;
}
</style>
<div id="voice"></div>
<script src="__STATIC__/libs/jplayer/ttw-clarity-player.js?3"></script>
<script src="__STATIC__/libs/jplayer/yepnope.js"></script>
<script type="text/javascript">
var url_array = [

	{volist name="$listdb" id="rs"}
			{
                mp3:"{$rs['url']}",
                duration:"2:21",
                cover:"{$rs['info']['picurl']|default='/public/static/libs/jplayer/css/images/bg.jpg'}",
                title:"{$rs.title}",
                artist:"{$rs['info']['uid']|get_user_name}",
                background:'',
				play_time:{$rs.playtime},
				info_id:"{$rs.aid}",
				info_sid:"{$rs.sid}",
				info_page:"{:urls('content/show',['id'=>$rs['aid']])}?sid={$rs.sid}",
            },
	{/volist}
			 
        ];

var clarity;

$(function () {
        clarity = $('#voice').ttwClarityPlayer(url_array,{
				jPlayer:{
					supplied:'mp3',
					errorAlerts:true,	
					autoPlay:true,				
					warningAlerts:true,
					consoleAlerts:true,
					smoothPlayBar:true,
					ready: function (e) {
						$(this).jPlayer("play",url_array[0].play_time);
					},
				}
			});

       // setTimeout(function(){clarity.play();}, 1500 );

		//$('#voice-size-picker').on('click', 'li', function(){
        //    $('#voice').attr('data-size', $(this).data('size'));
        //    clarity.manageLayout();
        //});
});


function now_play_voice(index){	//当前正在播放第几首
	$(".qb_ui_ListArticleTimeTitleCnt h3 a").removeClass('choose');
	$(".qb_ui_ListArticleTimeTitleCnt h3 a").eq(index).addClass('choose');
	check_power(index);
}
</script>

<!--用到的JS-->
{include file="fav/inc"}

<div style="height:20px;"></div>
<!------------音乐播放器结束---------->

		{volist name="$listdb" id="rs"}
			<ul class="qb_ui_ListArticleTimeTitleCnt listdiv_{$key}">
				<ol>
					<dl><i class="fa fa-headphones" style="font-size:45px;"></i></dl>
				</ol>
				<li>
					<h3><a href="{:urls('content/show',['id'=>$rs['aid']])}?sid={$rs.sid}">{$rs.title|get_word=100}</a></h3>
					<p>主题：《{$rs['info']['title']}》 发布者：{:get_user_name($rs['info']['uid'])} <i onclick="del_fav({$rs.aid},{$rs.sid},{$key})" class="glyphicon glyphicon-remove-circle">移除</i></p>
				</li>
			</ul>
		{/volist}
	</div>
</div>

<script>
function del_fav(id,sid,i){
	var url="{:urls('wxapp.fav/delete')}?type={$type}&id="+id+"&sid="+sid;
	$.get(url,function(res){
		if(res.code==0){
			layer.msg('成功移除');
			$(".listdiv_"+i).remove();
		}else{
			layer.alert(res.msg);
		}
	})
}
</script>

{/block}